home *** CD-ROM | disk | FTP | other *** search
/ Champak 26 (Anniversary Edition) / Volume 26 [Anniversary Edition] - JOGO DISK .iso / DEPOSITO / REmovido / Puzzle / Puzzle Soko.swf / scripts / DefineButton2_173 / BUTTONCONDACTION on(press, keyPress Right).as
Text File  |  2002-02-08  |  3KB  |  132 lines

  1. on(press, keyPress "<Right>"){
  2.    sound.gotoAndPlay("s0");
  3.    man.gotoAndPlay("right");
  4.    if(a[mx + 1][my] == "0" || a[mx + 1][my] == "2")
  5.    {
  6.       key = "4";
  7.       setProperty("man", _X, getProperty(man, _X) + id);
  8.       mx += 1;
  9.       step += 1;
  10.    }
  11.    else if(a[mx + 1][my] == "3")
  12.    {
  13.       if(a[mx + 2][my] == "0")
  14.       {
  15.          key = "4";
  16.          sound.gotoAndPlay("s2");
  17.          back = 1;
  18.          onchange = 0;
  19.          keyc = 4;
  20.          hyx = mx;
  21.          hyy = my;
  22.          zh = a[mx + 1][my];
  23.          zh2 = a[mx + 2][my];
  24.          a[mx + 1][my] = "0";
  25.          a[mx + 2][my] = "3";
  26.          setProperty("man", _X, getProperty(man, _X) + id);
  27.          mx += 1;
  28.          i = 0;
  29.          while(s >= i)
  30.          {
  31.             if(bx[i] == mx && by[i] == my)
  32.             {
  33.                setProperty("xx" add i, _X, getProperty("xx" add i, _X) + id);
  34.                bx[i] = mx + 1;
  35.                hby = i;
  36.             }
  37.             i++;
  38.          }
  39.          step += 1;
  40.       }
  41.       else if(a[mx + 2][my] == "2")
  42.       {
  43.          key = "4";
  44.          sound.gotoAndPlay("s2");
  45.          back = 1;
  46.          keyc = 4;
  47.          onchange = 1;
  48.          hyx = mx;
  49.          hyy = my;
  50.          zh = a[mx + 1][my];
  51.          zh2 = a[mx + 2][my];
  52.          a[mx + 1][my] = "0";
  53.          a[mx + 2][my] = "4";
  54.          setProperty("man", _X, getProperty(man, _X) + id);
  55.          mx += 1;
  56.          i = 0;
  57.          while(s >= i)
  58.          {
  59.             if(bx[i] == mx && by[i] == my)
  60.             {
  61.                setProperty("xx" add i, _X, getProperty("xx" add i, _X) + id);
  62.                bx[i] = mx + 1;
  63.                hby = i;
  64.             }
  65.             i++;
  66.          }
  67.          onit += 1;
  68.          step += 1;
  69.       }
  70.    }
  71.    else if(a[mx + 1][my] == "4")
  72.    {
  73.       if(a[mx + 2][my] == "0")
  74.       {
  75.          key = "4";
  76.          sound.gotoAndPlay("s2");
  77.          back = 1;
  78.          onchange = 0;
  79.          keyc = 4;
  80.          hyx = mx;
  81.          hyy = my;
  82.          zh = a[mx + 1][my];
  83.          zh2 = a[mx + 2][my];
  84.          a[mx + 1][my] = "2";
  85.          a[mx + 2][my] = "3";
  86.          setProperty("man", _X, getProperty(man, _X) + id);
  87.          mx += 1;
  88.          i = 0;
  89.          while(s >= i)
  90.          {
  91.             if(bx[i] == mx && by[i] == my)
  92.             {
  93.                setProperty("xx" add i, _X, getProperty("xx" add i, _X) + id);
  94.                bx[i] = mx + 1;
  95.                hby = i;
  96.             }
  97.             i++;
  98.          }
  99.          onit -= 1;
  100.          step += 1;
  101.       }
  102.       else if(a[mx + 2][my] == "2")
  103.       {
  104.          key = "4";
  105.          sound.gotoAndPlay("s2");
  106.          back = 1;
  107.          onchange = 0;
  108.          keyc = 4;
  109.          hyx = mx;
  110.          hyy = my;
  111.          zh = a[mx + 1][my];
  112.          zh2 = a[mx + 2][my];
  113.          a[mx + 1][my] = "2";
  114.          a[mx + 2][my] = "4";
  115.          setProperty("man", _X, getProperty(man, _X) + id);
  116.          mx += 1;
  117.          i = 0;
  118.          while(s >= i)
  119.          {
  120.             if(bx[i] == mx && by[i] == my)
  121.             {
  122.                setProperty("xx" add i, _X, getProperty("xx" add i, _X) + id);
  123.                bx[i] = mx + 1;
  124.                hby = i;
  125.             }
  126.             i++;
  127.          }
  128.          step += 1;
  129.       }
  130.    }
  131. }
  132.